package com.qianfeng.taoyuan.volleyDemo;

import android.graphics.Bitmap;
import android.util.Log;

import com.android.volley.toolbox.ImageLoader;

/**
 * Created by Administrator on 2015/8/3.
 */
public class MyImageCache implements ImageLoader.ImageCache {
    private static MyImageCache cache;

    private MyImageCache() {
    }

    public static MyImageCache getImageCacheInstance(){
        if (cache==null){
            cache = new MyImageCache();
        }
        return cache;
    }
    @Override
    public Bitmap getBitmap(String url) {
        Bitmap bitmap = MyLruCache.getInstance().get(url);
        Log.e("getBitmap",bitmap+"");
        return bitmap;
    }

    @Override
    public void putBitmap(String url, Bitmap bitmap) {
        MyLruCache.getInstance().put(url,bitmap);
        Log.e("putBitmap",bitmap+"");
    }
}
